#include "mainplaywidget.h"
#include "ui_mainplaywidget.h"

MainPlayWidget::MainPlayWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MainPlayWidget)
{
    ui->setupUi(this);

    mPlayWidget = new PlayVideoWidget(this);
    QVBoxLayout *tHLayout = new QVBoxLayout(ui->frame2);
    tHLayout->setMargin(0);
    tHLayout->setSpacing(0);
    tHLayout->setContentsMargins(0,0,0,0);
    tHLayout->addWidget(mPlayWidget);
}

MainPlayWidget::~MainPlayWidget()
{
    delete ui;
}

void MainPlayWidget::on_btnPlay_clicked()
{
    QString urlStr = ui->lineUrl->text().trimmed();

    mPlayWidget->set_url(urlStr);
    mPlayWidget->play();
}

void MainPlayWidget::on_btnStop_clicked()
{
     mPlayWidget->stop();
}
